﻿using AutoMapper;
using Enferno.Public.Web.Models;
using Enferno.Public.Web.ViewModels;

namespace Enferno.Public.Web.Mappers.PromotionProfiles
{
    public class PromotionModelToPromotionViewModelProfile :
        PromotionBaseModelToPromotionBaseViewModelProfile<PromotionModel, ProductFileModel, PromotionViewModel>
    {
        
    }

    public class PromotionBaseModelToPromotionBaseViewModelProfile<TPromotionModel, TProductFileModel, TPromotionViewModel> : Profile
        where TPromotionModel: PromotionBaseModel<TProductFileModel>
        where TProductFileModel: ProductFileModel
        where TPromotionViewModel: PromotionViewModel
    {
        protected override void Configure()
        {
            Mapper.CreateMap<TPromotionModel, TPromotionViewModel>();
        }

        public override string ProfileName
        {
            get { return GetType().Name; }
        }
    }
}
